cmake_minimum_required(VERSION 3.8)
# 编译调试-DCMAKE_BUILD_TYPE=debug
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

project(logmodule)

file(GLOB_RECURSE srcs ${CMAKE_CURRENT_SOURCE_DIR}/base/src/*cpp 
                       ${CMAKE_CURRENT_SOURCE_DIR}/log/src/*.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/Main/src/*.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/util/src/*.cpp
)


add_library(log SHARED ${srcs})
#add_library(log STATIC ${srcs})

target_include_directories(log PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/log/include 
                                      ${CMAKE_CURRENT_SOURCE_DIR}/base/include 
                                      ${CMAKE_CURRENT_SOURCE_DIR}/Main/include 
                                      ${CMAKE_CURRENT_SOURCE_DIR}/util/include
)


file(GLOB_RECURSE run_src ${CMAKE_CURRENT_SOURCE_DIR}/run/src/*.cpp)

add_executable(logrun ${run_src})

target_include_directories(logrun PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/run/include)
  
                
target_link_libraries(logrun log pthread dl)

#include <log/sink.h>
# 添加子目录
add_subdirectory(base)




